// 用户相关请求模块
import request from '@/utils/request'
import qs from 'qs'
interface User {
    phone:string
    password:string
}

export const login = (data:User) => {
  return request({
    headers: { 'content-type': 'application/x-www-form-urlencoded' },
    method: 'POST',
    url: '/front/user/login',
    data: qs.stringify(data)// axios默认发送application/json格式
  })
}

export const getUserInfo = () => {
  return request({

    method: 'GET',
    url: '/front/user/getInfo'

  })
}

export const getUserPages = (data:any) => {
  return request({
    method: 'POST',
    url: '/boss/user/getUserPages',
    data

  })
}

export const forbidUser = (data:any) => {
  return request({
    method: 'POST',
    url: '/boss/user/forbidUser',
    data

  })
}

export const enableUser = (id:any) => {
  return request({
    method: 'GET',
    url: '/boss/user/enableUser',
    params: {
      userId: id
    }

  })
}
